package corejava;

/**
 * @Author: YLBG-YCY-1325
 * @Description:
 * @Date: 2017/3/31
 */
public enum Size {
    SMALL("S"),
    MEDIUM("M"),
    LARGE("L"),
    EXTRA_LARGE("XL");

    private String abbreviation;

    private Size(String abbreviation){
        this.abbreviation = abbreviation;
    }

    public String getAbbreviation() {
        return abbreviation;
    }
}
class SizeDemo{
    public static void main(String[] args) {
        System.out.println(Size.SMALL.toString());
        Size s = Enum.valueOf(Size.class,"LARGE");
        Size size = Size.EXTRA_LARGE;
        System.out.println(s.toString());
        System.out.println(s.compareTo(size));
    }
}